package binary_evolution;

import misc.not_Legal_Exception;
import evolution_superclasses.Genotype;
import evolution_superclasses.Phenotype;

public class Binary_Phenotype extends Phenotype {
	protected int[] _integers;

	public Binary_Phenotype(Binary_Genotype gen) {
		super(gen);
	}

	public int[] get_integers() {
		return _integers;
	}

	public void set_integers(int[] integers) {
		_integers = integers;
	}

	@Override
	protected void develop(Genotype gen) throws not_Legal_Exception{
		_integers = new int[gen.get_genSize()];
		
		int i=0;
		for(boolean b : ((Binary_Genotype)gen).get_binaryArray()){
			_integers[i++] = b?1:0;
		}
	}

	@Override
	public String toString() {
		String s = "";
		for(int i :get_integers()){
			s += i;
		}
		return s;
	}
	

}
